package com.uw.uwrpc.core.exception;

import lombok.Getter;

@Getter
public class RpcException extends RuntimeException {

    private final ErrorCode errorCode;

    public RpcException(String message) {
        super(message);
        this.errorCode = ErrorCode.undefined;
    }

    public RpcException(Throwable cause) {
        super(cause);
        this.errorCode = ErrorCode.undefined;
    }

    public RpcException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public RpcException(ErrorCode errorCode, Throwable cause) {
        super(errorCode.getMessage(), cause);
        this.errorCode = errorCode;
    }



}
